import request from "../request";

const controller = "User";

export const getConfigOfAPP_API = () => {
  return request.get(`${controller}/getConfigOfAPP`);
};

export const createDefaultConfig_API = () => {
  return request.get(`${controller}/createDefaultConfig`);
};

export const Login_API = (data) => {
  return request.get(`${controller}/Login?${queryStr(data)}`);
};

const queryStr = (data) => {
  let str = "";
  for (var key in data) {
    str += `${key}=${data[key]}&`;
  }
  if (str[str.length - 1] == "&") {
    str = str.substring(0, str.length - 1);
  }
  return str;
};
